﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Xml;

namespace SimpleText.Framework
{

	/// <summary>
	/// Summary description for Text
	/// </summary>
	public class Text
	{
		public Text()
		{
		}
		public string Content { get; set; }
		public string LanguageShortName { get; set; }

		public void InitWithXml(XmlNode xmlNode)
		{
			Content = xmlNode.InnerText;
			LanguageShortName = xmlNode.Attributes["language"].Value;
		}

		public string GetAsXml()
		{
			return GetAsXml("");
		}
		public string GetAsXml(string baseIndent)
		{
			//string indent = "\t";

			return baseIndent + "<text language=\"" + LanguageShortName + "\"><![CDATA[" + Content + "]]></text>";
		}

	}
}